// 测试2：客户端给服务端发送一次数据后，经过一段时间休眠，看服务端是否进行非活跃连接的释放

#include "../source/server.hpp"

int main()
{
    Socket socket;
    socket.CreateClient(8080, "127.0.0.1");
    std::string str = "GET / HTTP/1.1\r\nConnection: keep-alive\r\nContent-Length: 0\r\n\r\n";
    while (1)
    {
        socket.Send(str.c_str(), str.size());
        char buffer[1024] = {0};
        socket.Recv(buffer, sizeof(buffer) - 1);
        std::cout << buffer << std::endl;
        sleep(13);
    }
    socket.Close();
    return 0;
}